package com.yy.poly_.detail_;

/**
 * chapter08  com.yy.poly_.detail_
 * 2023-04-08 23:05
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/4/8 23:05
 */
public class PolyDetail03 {
    public static void main(String[] args) {
        BB bb = new BB();
        System.out.println(bb instanceof BB); //true
        System.out.println(bb instanceof AA); //true


        //aa 编译类型 AA, 运行类型是BB
        AA aa = new BB();
        System.out.println(aa instanceof AA);//true
        System.out.println(aa instanceof BB);//true

        Object o = new Object();
        System.out.println(o instanceof AA);// false


        String s = "hehe";
        //String m = new String("hh");
    //    System.out.println(s instanceof AA);
        System.out.println(s instanceof Object); //true

        Object op = new Integer(5);
        String str = (String)op;
    }
}
class AA{ //父类

}
class BB extends AA{ //子类

}
